# -*- coding:utf-8 -*-
# @Time:2024/4/1921:01
# @Author:miuzg
# @FileName:new test2.py
# @Software:PyCharm
# 定义一个员工类
class Employee:
    # 初始化方法来初始化实例对象的属性
    def __init__(self, name, age):
        self.name = name
        self.age = age

    # 定义test方法输出self
    def test(self):
        print(self)

emp1 = Employee('Allen', 20)
print(emp1)
emp1.test()
print(Employee.test())
# <__main__.Employee object at 0x000001E8D6006A00>
# <__main__.Employee object at 0x000001E8D6006A00>
# 输出结果都是内存地址，就代表self为对象本身
